# Maintainer: Luca Weiss <luca@z3ntu.xyz>
# Contributor: Brandon Boese <brandonboese@protonmail.com>
pkgname=lomiri-clock-app
pkgver=4.0.3
pkgrel=0
pkgdesc="Clock App for Lomiri Operating Environment"
url="https://gitlab.com/ubports/development/apps/lomiri-clock-app"
arch="all !armhf" # blocked by lomiri-ui-toolkit
license="GPL-3.0-only"
depends="
	geonames
	gsettings-qt
	lomiri-libusermetrics
	lomiri-ui-extras
	lomiri-ui-toolkit
	qt5-qtlocation
	u1db-qt
	"
makedepends="
	click-dev
	cmake
	cmake-extras
	geonames-dev
	gnome-desktop-dev
	lomiri-trust-store-dev
	qt5-qtbase-dev
	qt5-qtdeclarative
	qt5-qtdeclarative-dev
	samurai
	"
checkdepends="
	py3-dbusmock
	py3-xdg
	xvfb-run
	"
subpackages="$pkgname-lang"
source="https://gitlab.com/ubports/development/apps/lomiri-clock-app/-/archive/v$pkgver/lomiri-clock-app-v$pkgver.tar.gz
	0001-point-qmlscene-to-qmlscene-qt5.patch
	"
builddir="$srcdir/$pkgname-v$pkgver"
options="!check" # tests do not run

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=ON \
		-DCMAKE_BUILD_TYPE=None \
		-DCLICK_MODE=OFF
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
d906a34e789dbd486af5c4837ab076485737217910d95bbe1e9b0b8453356c5d08373cd700dd768f41b2440e7c9a57fb7ca699a4fa73f80cf03e66bec3bc0cc4  lomiri-clock-app-v4.0.3.tar.gz
eccc0ef81f43d59271a613a74eb71c1fa809e5afed581188878dd608a485ee9b2baf7b2f34242cc650bbc35b2a63782d9fa053f1a01e23ce9c5e8a995619a06e  0001-point-qmlscene-to-qmlscene-qt5.patch
"
